 <?php
include("../includes/common.php");
if($islogin2==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
include './head.php';
?>
<?php
$uid=$rs=$DB->query("select * from pay_user WHERE name={$pid}"); 
foreach($uid as $res){
 $usid=$res['id'];
}
$uid=$rs=$DB->query("select * from pay_user WHERE name={$pid}");
foreach($uid as $res){
 $usid=$res['id'];
}
$sql=0;
$numrows=$DB->query("SELECT count(*) from pay_userpay WHERE pid={$usid}")->fetchColumn();
$pagesize=25;
$pages=intval($numrows/$pagesize);
if ($numrows%$pagesize)
{
 $pages++;
 }
if (isset($_GET['page'])){
$page=intval($_GET['page']);
}
else{
$page=1;
}
$offset=$pagesize*($page - 1);

$list=$DB->query("SELECT * FROM pay_userpay WHERE pid={$usid} order by time desc limit $offset,$pagesize")->fetchAll();
?>			            

<div class="clearfix"></div>
  <div class="content-wrapper">
    <div class="container-fluid">  
     <div class="row pt-2 pb-2">
        <div class="col-sm-9">
            <h4 class="page-title">转账记录</h4>
            <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="javaScript:void();">转账</a></li>
            <li class="breadcrumb-item"><a href="javaScript:void();">记录</a></li>
            <li class="breadcrumb-item active" aria-current="page">信息</li>
         </ol>
       </div>
      </div>
     </div>

 <div class="row">
        <div class="col-lg-12">
          <div class="card">
            <div class="card-header"><i class="fa fa-table"></i>订单记录&nbsp; <span class="badge badge-pill badge-danger m-1"><?php echo $numrows?></span>
            </div>
            <div class="card-body">
              <div class="table-responsive">

              <table id="default-datatable" class="table table-bordered">
                <thead>
                    <tr>
                                <th>商户ID</th>
                                <th>收款商户ID</th>
                                <th>转账金额</th>
                                <th>转账时间</th>
                                <th>转账IP</th>
                                
                    </tr>
                </thead>
                <tbody>
                    
                       <?php
                 foreach($list as $res){
              echo '<tr><td>'.$res['pid'].'</td>
                        <td>'.$res['uid'].'</td>
                        <td>￥ <b>'.$res['money'].'</b></td>
                        <td>'.$res['time'].'</td>
                        <td>'.$res['ip'].'</td>
                        </tr>';
                  }
                  ?>
                  
                    </tbody>
                    </table>
           </div>
      </div>
</div>
</div>
</div>
<?php
echo'<ul class="pagination pagination-separate pagination-round pagination-sm">';
$first=1;
$prev=$page-1;
$next=$page+1;
$last=$pages;
if ($page>1)
{
echo '<li class="page-item"><a class="page-link" href="records.php?page='.$first.$link.'">首页</a></li>';
echo '<li class="page-item"><a class="page-link" href="records.php?page='.$prev.$link.'">&laquo;</a></li>';
} else {
echo '<li class="page-item"><a class="page-link">首页</a></li>';
echo '<li class="page-item"><a class="page-link">&laquo;</a></li>';
}
for ($i=1;$i<$page;$i++)
echo '<li class="page-item"><a class="page-link" href="records.php?page='.$i.$link.'">'.$i .'</a></li>';
echo '<li class="page-item"><a class="page-link">'.$page.'</a></li>';
if($pages>=10)$sss=$page+10;else $sss=$pages;
for ($i=$page+1;$i<=$sss;$i++)
echo '<li class="page-item"><a class="page-link" href="records.php?page='.$i.$link.'">'.$i .'</a></li>';
echo '';
if ($page<$pages)
{
echo '<li class="page-item"><a class="page-link" href="records.php?page='.$next.$link.'">&raquo;</a></li>';
echo '<li class="page-item"><a class="page-link" href="records.php?page='.$last.$link.'">尾页</a></li>';
} else {
echo '<li class="page-item"><a class="page-link">&raquo;</a></li>';
echo '<li class="page-item"><a class="page-link">尾页</a></li>';
}
echo'</ul>';
#分页
?>
</div>
    </div>
        </div>
      </div>
    </div>
    </div>
    <a href="javaScript:void();" class="back-to-top"><i class="fa fa-angle-double-up"></i> </a>
    
  </div>
  <script src="/user/kuyun/plugins/bootstrap-datatable/js/jquery.dataTables.min.js"></script>
  <script src="/user/kuyun/plugins/bootstrap-datatable/js/dataTables.bootstrap4.min.js"></script>
  <script src="/user/kuyun/plugins/bootstrap-datatable/js/dataTables.buttons.min.js"></script>
  <script src="/user/kuyun/plugins/bootstrap-datatable/js/buttons.bootstrap4.min.js"></script>
  <script src="/user/kuyun/plugins/bootstrap-datatable/js/jszip.min.js"></script>
  <script src="/user/kuyun/plugins/bootstrap-datatable/js/pdfmake.min.js"></script>
  <script src="/user/kuyun/plugins/bootstrap-datatable/js/vfs_fonts.js"></script>
  <script src="/user/kuyun/plugins/bootstrap-datatable/js/buttons.html5.min.js"></script>
  <script src="/user/kuyun/plugins/bootstrap-datatable/js/buttons.print.min.js"></script>
  <script src="/user/kuyun/plugins/bootstrap-datatable/js/buttons.colVis.min.js"></script>


  <?php include 'foot.php';?>


